3.1.92 \(\int \cosh (c+d x) (a+b \tanh ^2(c+d x))^2 \, dx\) [92]

3.1.92.1 Optimal result
3.1.92.2 Mathematica [A] (verified)
3.1.92.3 Rubi [A] (verified)
3.1.92.4 Maple [A] (verified)
3.1.92.5 Fricas [B] (verification not implemented)
3.1.92.6 Sympy [F]
3.1.92.7 Maxima [B] (verification not implemented)
3.1.92.8 Giac [B] (verification not implemented)
3.1.92.9 Mupad [B] (verification not implemented)

3.1.92.1 Optimal result

Integrand size = 21, antiderivative size = 60 \[ \int \cosh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=-\frac {b (4 a+3 b) \arctan (\sinh (c+d x))}{2 d}+\frac {(a+b)^2 \sinh (c+d x)}{d}+\frac {b^2 \text {sech}(c+d x) \tanh (c+d x)}{2 d} \]

output
-1/2*b*(4*a+3*b)*arctan(sinh(d*x+c))/d+(a+b)^2*sinh(d*x+c)/d+1/2*b^2*sech( 
d*x+c)*tanh(d*x+c)/d
 
3.1.92.2 Mathematica [A] (verified)

Time = 0.21 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.90 \[ \int \cosh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {2 (a+b)^2 \sinh (c+d x)+b (-((4 a+3 b) \arctan (\sinh (c+d x)))+b \text {sech}(c+d x) \tanh (c+d x))}{2 d} \]

input
Integrate[Cosh[c + d*x]*(a + b*Tanh[c + d*x]^2)^2,x]
 
output
(2*(a + b)^2*Sinh[c + d*x] + b*(-((4*a + 3*b)*ArcTan[Sinh[c + d*x]]) + b*S 
ech[c + d*x]*Tanh[c + d*x]))/(2*d)
 
3.1.92.3 Rubi [A] (verified)

Time = 0.28 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.02, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 4159, 300, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \cosh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a-b \tan (i c+i d x)^2\right )^2}{\sec (i c+i d x)}dx\)

\(\Big \downarrow \) 4159

\(\displaystyle \frac {\int \frac {\left ((a+b) \sinh ^2(c+d x)+a\right )^2}{\left (\sinh ^2(c+d x)+1\right )^2}d\sinh (c+d x)}{d}\)

\(\Big \downarrow \) 300

\(\displaystyle \frac {\int \left ((a+b)^2-\frac {2 b (a+b) \sinh ^2(c+d x)+b (2 a+b)}{\left (\sinh ^2(c+d x)+1\right )^2}\right )d\sinh (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {-\frac {1}{2} b (4 a+3 b) \arctan (\sinh (c+d x))+(a+b)^2 \sinh (c+d x)+\frac {b^2 \sinh (c+d x)}{2 \left (\sinh ^2(c+d x)+1\right )}}{d}\)

input
Int[Cosh[c + d*x]*(a + b*Tanh[c + d*x]^2)^2,x]
 
output
(-1/2*(b*(4*a + 3*b)*ArcTan[Sinh[c + d*x]]) + (a + b)^2*Sinh[c + d*x] + (b 
^2*Sinh[c + d*x])/(2*(1 + Sinh[c + d*x]^2)))/d
 

3.1.92.3.1 Defintions of rubi rules used

rule 300
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int 
[PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c 
, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4159
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_ 
))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f 
  Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2 
*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f} 
, x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2] && IntegerQ[p]
 
3.1.92.4 Maple [A] (verified)

Time = 0.96 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.62

method result size
derivativedivides \(\frac {a^{2} \sinh \left (d x +c \right )+2 a b \left (\sinh \left (d x +c \right )-2 \arctan \left ({\mathrm e}^{d x +c}\right )\right )+b^{2} \left (\frac {\sinh \left (d x +c \right )^{3}}{\cosh \left (d x +c \right )^{2}}+\frac {3 \sinh \left (d x +c \right )}{\cosh \left (d x +c \right )^{2}}-\frac {3 \,\operatorname {sech}\left (d x +c \right ) \tanh \left (d x +c \right )}{2}-3 \arctan \left ({\mathrm e}^{d x +c}\right )\right )}{d}\) \(97\)
default \(\frac {a^{2} \sinh \left (d x +c \right )+2 a b \left (\sinh \left (d x +c \right )-2 \arctan \left ({\mathrm e}^{d x +c}\right )\right )+b^{2} \left (\frac {\sinh \left (d x +c \right )^{3}}{\cosh \left (d x +c \right )^{2}}+\frac {3 \sinh \left (d x +c \right )}{\cosh \left (d x +c \right )^{2}}-\frac {3 \,\operatorname {sech}\left (d x +c \right ) \tanh \left (d x +c \right )}{2}-3 \arctan \left ({\mathrm e}^{d x +c}\right )\right )}{d}\) \(97\)
risch \(\frac {{\mathrm e}^{d x +c} a^{2}}{2 d}+\frac {{\mathrm e}^{d x +c} a b}{d}+\frac {{\mathrm e}^{d x +c} b^{2}}{2 d}-\frac {{\mathrm e}^{-d x -c} a^{2}}{2 d}-\frac {{\mathrm e}^{-d x -c} a b}{d}-\frac {{\mathrm e}^{-d x -c} b^{2}}{2 d}+\frac {b^{2} {\mathrm e}^{d x +c} \left ({\mathrm e}^{2 d x +2 c}-1\right )}{d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{2}}+\frac {2 i b \ln \left ({\mathrm e}^{d x +c}-i\right ) a}{d}+\frac {3 i b^{2} \ln \left ({\mathrm e}^{d x +c}-i\right )}{2 d}-\frac {2 i b a \ln \left ({\mathrm e}^{d x +c}+i\right )}{d}-\frac {3 i b^{2} \ln \left ({\mathrm e}^{d x +c}+i\right )}{2 d}\) \(203\)

input
int(cosh(d*x+c)*(a+b*tanh(d*x+c)^2)^2,x,method=_RETURNVERBOSE)
 
output
1/d*(a^2*sinh(d*x+c)+2*a*b*(sinh(d*x+c)-2*arctan(exp(d*x+c)))+b^2*(sinh(d* 
x+c)^3/cosh(d*x+c)^2+3*sinh(d*x+c)/cosh(d*x+c)^2-3/2*sech(d*x+c)*tanh(d*x+ 
c)-3*arctan(exp(d*x+c))))
 
3.1.92.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 774 vs. \(2 (56) = 112\).

Time = 0.28 (sec) , antiderivative size = 774, normalized size of antiderivative = 12.90 \[ \int \cosh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{6} + 6 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{5} + {\left (a^{2} + 2 \, a b + b^{2}\right )} \sinh \left (d x + c\right )^{6} + {\left (a^{2} + 2 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )^{4} + {\left (15 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{2} + a^{2} + 2 \, a b + 3 \, b^{2}\right )} \sinh \left (d x + c\right )^{4} + 4 \, {\left (5 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{3} + {\left (a^{2} + 2 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{3} - {\left (a^{2} + 2 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )^{2} + {\left (15 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{4} + 6 \, {\left (a^{2} + 2 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )^{2} - a^{2} - 2 \, a b - 3 \, b^{2}\right )} \sinh \left (d x + c\right )^{2} - a^{2} - 2 \, a b - b^{2} - 2 \, {\left ({\left (4 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )^{5} + 5 \, {\left (4 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{4} + {\left (4 \, a b + 3 \, b^{2}\right )} \sinh \left (d x + c\right )^{5} + 2 \, {\left (4 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )^{3} + 2 \, {\left (5 \, {\left (4 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )^{2} + 4 \, a b + 3 \, b^{2}\right )} \sinh \left (d x + c\right )^{3} + 2 \, {\left (5 \, {\left (4 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )^{3} + 3 \, {\left (4 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{2} + {\left (4 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right ) + {\left (5 \, {\left (4 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )^{4} + 6 \, {\left (4 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )^{2} + 4 \, a b + 3 \, b^{2}\right )} \sinh \left (d x + c\right )\right )} \arctan \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right )\right ) + 2 \, {\left (3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{5} + 2 \, {\left (a^{2} + 2 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )^{3} - {\left (a^{2} + 2 \, a b + 3 \, b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )}{2 \, {\left (d \cosh \left (d x + c\right )^{5} + 5 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{4} + d \sinh \left (d x + c\right )^{5} + 2 \, d \cosh \left (d x + c\right )^{3} + 2 \, {\left (5 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )^{3} + 2 \, {\left (5 \, d \cosh \left (d x + c\right )^{3} + 3 \, d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{2} + d \cosh \left (d x + c\right ) + {\left (5 \, d \cosh \left (d x + c\right )^{4} + 6 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )\right )}} \]

input
integrate(cosh(d*x+c)*(a+b*tanh(d*x+c)^2)^2,x, algorithm="fricas")
 
output
1/2*((a^2 + 2*a*b + b^2)*cosh(d*x + c)^6 + 6*(a^2 + 2*a*b + b^2)*cosh(d*x 
+ c)*sinh(d*x + c)^5 + (a^2 + 2*a*b + b^2)*sinh(d*x + c)^6 + (a^2 + 2*a*b 
+ 3*b^2)*cosh(d*x + c)^4 + (15*(a^2 + 2*a*b + b^2)*cosh(d*x + c)^2 + a^2 + 
 2*a*b + 3*b^2)*sinh(d*x + c)^4 + 4*(5*(a^2 + 2*a*b + b^2)*cosh(d*x + c)^3 
 + (a^2 + 2*a*b + 3*b^2)*cosh(d*x + c))*sinh(d*x + c)^3 - (a^2 + 2*a*b + 3 
*b^2)*cosh(d*x + c)^2 + (15*(a^2 + 2*a*b + b^2)*cosh(d*x + c)^4 + 6*(a^2 + 
 2*a*b + 3*b^2)*cosh(d*x + c)^2 - a^2 - 2*a*b - 3*b^2)*sinh(d*x + c)^2 - a 
^2 - 2*a*b - b^2 - 2*((4*a*b + 3*b^2)*cosh(d*x + c)^5 + 5*(4*a*b + 3*b^2)* 
cosh(d*x + c)*sinh(d*x + c)^4 + (4*a*b + 3*b^2)*sinh(d*x + c)^5 + 2*(4*a*b 
 + 3*b^2)*cosh(d*x + c)^3 + 2*(5*(4*a*b + 3*b^2)*cosh(d*x + c)^2 + 4*a*b + 
 3*b^2)*sinh(d*x + c)^3 + 2*(5*(4*a*b + 3*b^2)*cosh(d*x + c)^3 + 3*(4*a*b 
+ 3*b^2)*cosh(d*x + c))*sinh(d*x + c)^2 + (4*a*b + 3*b^2)*cosh(d*x + c) + 
(5*(4*a*b + 3*b^2)*cosh(d*x + c)^4 + 6*(4*a*b + 3*b^2)*cosh(d*x + c)^2 + 4 
*a*b + 3*b^2)*sinh(d*x + c))*arctan(cosh(d*x + c) + sinh(d*x + c)) + 2*(3* 
(a^2 + 2*a*b + b^2)*cosh(d*x + c)^5 + 2*(a^2 + 2*a*b + 3*b^2)*cosh(d*x + c 
)^3 - (a^2 + 2*a*b + 3*b^2)*cosh(d*x + c))*sinh(d*x + c))/(d*cosh(d*x + c) 
^5 + 5*d*cosh(d*x + c)*sinh(d*x + c)^4 + d*sinh(d*x + c)^5 + 2*d*cosh(d*x 
+ c)^3 + 2*(5*d*cosh(d*x + c)^2 + d)*sinh(d*x + c)^3 + 2*(5*d*cosh(d*x + c 
)^3 + 3*d*cosh(d*x + c))*sinh(d*x + c)^2 + d*cosh(d*x + c) + (5*d*cosh(d*x 
 + c)^4 + 6*d*cosh(d*x + c)^2 + d)*sinh(d*x + c))
 
3.1.92.6 Sympy [F]

\[ \int \cosh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\int \left (a + b \tanh ^{2}{\left (c + d x \right )}\right )^{2} \cosh {\left (c + d x \right )}\, dx \]

input
integrate(cosh(d*x+c)*(a+b*tanh(d*x+c)**2)**2,x)
 
output
Integral((a + b*tanh(c + d*x)**2)**2*cosh(c + d*x), x)
 
3.1.92.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 152 vs. \(2 (56) = 112\).

Time = 0.28 (sec) , antiderivative size = 152, normalized size of antiderivative = 2.53 \[ \int \cosh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {1}{2} \, b^{2} {\left (\frac {6 \, \arctan \left (e^{\left (-d x - c\right )}\right )}{d} - \frac {e^{\left (-d x - c\right )}}{d} + \frac {4 \, e^{\left (-2 \, d x - 2 \, c\right )} - e^{\left (-4 \, d x - 4 \, c\right )} + 1}{d {\left (e^{\left (-d x - c\right )} + 2 \, e^{\left (-3 \, d x - 3 \, c\right )} + e^{\left (-5 \, d x - 5 \, c\right )}\right )}}\right )} + a b {\left (\frac {4 \, \arctan \left (e^{\left (-d x - c\right )}\right )}{d} + \frac {e^{\left (d x + c\right )}}{d} - \frac {e^{\left (-d x - c\right )}}{d}\right )} + \frac {a^{2} \sinh \left (d x + c\right )}{d} \]

input
integrate(cosh(d*x+c)*(a+b*tanh(d*x+c)^2)^2,x, algorithm="maxima")
 
output
1/2*b^2*(6*arctan(e^(-d*x - c))/d - e^(-d*x - c)/d + (4*e^(-2*d*x - 2*c) - 
 e^(-4*d*x - 4*c) + 1)/(d*(e^(-d*x - c) + 2*e^(-3*d*x - 3*c) + e^(-5*d*x - 
 5*c)))) + a*b*(4*arctan(e^(-d*x - c))/d + e^(d*x + c)/d - e^(-d*x - c)/d) 
 + a^2*sinh(d*x + c)/d
 
3.1.92.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 160 vs. \(2 (56) = 112\).

Time = 0.33 (sec) , antiderivative size = 160, normalized size of antiderivative = 2.67 \[ \int \cosh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {2 \, a^{2} {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )} + 4 \, a b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )} + 2 \, b^{2} {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )} - {\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )} e^{\left (-d x - c\right )}\right )\right )} {\left (4 \, a b + 3 \, b^{2}\right )} + \frac {4 \, b^{2} {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}}{{\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{2} + 4}}{4 \, d} \]

input
integrate(cosh(d*x+c)*(a+b*tanh(d*x+c)^2)^2,x, algorithm="giac")
 
output
1/4*(2*a^2*(e^(d*x + c) - e^(-d*x - c)) + 4*a*b*(e^(d*x + c) - e^(-d*x - c 
)) + 2*b^2*(e^(d*x + c) - e^(-d*x - c)) - (pi + 2*arctan(1/2*(e^(2*d*x + 2 
*c) - 1)*e^(-d*x - c)))*(4*a*b + 3*b^2) + 4*b^2*(e^(d*x + c) - e^(-d*x - c 
))/((e^(d*x + c) - e^(-d*x - c))^2 + 4))/d
 
3.1.92.9 Mupad [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 182, normalized size of antiderivative = 3.03 \[ \int \cosh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {{\mathrm {e}}^{c+d\,x}\,{\left (a+b\right )}^2}{2\,d}-\frac {{\mathrm {e}}^{-c-d\,x}\,{\left (a+b\right )}^2}{2\,d}-\frac {\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (3\,b^2\,\sqrt {d^2}+4\,a\,b\,\sqrt {d^2}\right )}{d\,\sqrt {16\,a^2\,b^2+24\,a\,b^3+9\,b^4}}\right )\,\sqrt {16\,a^2\,b^2+24\,a\,b^3+9\,b^4}}{\sqrt {d^2}}+\frac {b^2\,{\mathrm {e}}^{c+d\,x}}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}-\frac {2\,b^2\,{\mathrm {e}}^{c+d\,x}}{d\,\left (2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1\right )} \]

input
int(cosh(c + d*x)*(a + b*tanh(c + d*x)^2)^2,x)
 
output
(exp(c + d*x)*(a + b)^2)/(2*d) - (exp(- c - d*x)*(a + b)^2)/(2*d) - (atan( 
(exp(d*x)*exp(c)*(3*b^2*(d^2)^(1/2) + 4*a*b*(d^2)^(1/2)))/(d*(24*a*b^3 + 9 
*b^4 + 16*a^2*b^2)^(1/2)))*(24*a*b^3 + 9*b^4 + 16*a^2*b^2)^(1/2))/(d^2)^(1 
/2) + (b^2*exp(c + d*x))/(d*(exp(2*c + 2*d*x) + 1)) - (2*b^2*exp(c + d*x)) 
/(d*(2*exp(2*c + 2*d*x) + exp(4*c + 4*d*x) + 1))